package funcionarios;
import java.util.regex.*;

public class Cpf {
	private String cpf;
	
	public Cpf(String cpf) throws Exception{
		this.cpf = cpf;
		if(!(valida1(cpf))){
			throw new Exception("CPF invalido");
		}
	}
	public boolean valida1(String cpf){
		Pattern padrao = Pattern.compile("[0-9]{3}.[0-9]{3}.[0-9]{3}-[0-9]{2}");
		Matcher meta = padrao.matcher(cpf);
		return meta.matches();
		
	}
	
}
